package com.example.chatweb.mapper;

import com.example.chatweb.entity.History;
import org.apache.ibatis.annotations.*;

import java.util.List;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

@Mapper
public interface HistoryMapper extends BaseMapper<History> {
}
    // 插入一条新的历史记录
//    @Insert("INSERT INTO history(role, content, topic, userid) VALUES(#{role}, #{content}, #{topic}, #{userid})")
//    @Options(useGeneratedKeys = true, keyProperty = "id")
//    void insertHistory(History history);
//
//
//
//    // 根据 ID 删除一条历史记录
//    @Delete("DELETE FROM history WHERE id = #{id}")
//    void deleteHistoryById(Long id);
//
//    // 更新一条历史记录
//    @Update("UPDATE history SET role = #{role}, content = #{content} WHERE id = #{id}")
//    void updateHistory(History history);
//
//    // 根据 ID 查询一条历史记录
//    @Select("SELECT * FROM history WHERE id = #{id}")
//    History selectHistoryById(Long id);
//
//    // 查询所有历史记录
//    @Select("SELECT * FROM history")
//    List<History> selectAllHistories();

